<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/firstint.css">
    <link rel="stylesheet" href="../css/goodsContent.css">
    <link rel="stylesheet" href="../font_3284096_xdkog32r6d/iconfont.css">
    <link rel="stylesheet" href="../css/donghua.css">
    <style>

    </style>
</head>

<body>
    <div id="header">
        <div class="header-center">
            <div class="logo">
                <a href="../html/firstint.html"><img src="../img/GIF/gif3.gif" alt="" style="height: 70px;width: 70px;padding-left: 30px;"></a>
            </div>
            <div class="list">
                <ul class="list-all">
                    <li>
                        <a href="goods.html">帽子</a> </li>
                    <li>
                        <a href="goods.html">外套</a> </li>
                    <li>
                        <a href="goods.html">裤子</a>
                    </li>
                    <li>
                        <a href="goods.html">背包</a>
                    </li>
                </ul>
            </div>
            <div class="search">
                <input type="text" text="搜索">
                <span class="iconfont icon-sousuo_o"></span>
            </div>
            <div class="user">
                <span class="iconfont  icon-201yonghu_yonghu2" style="font-size: 30px;line-height: 70px;"></span>
                <div style="font-size: 20px;line-height: 70px;text-decoration: none;color: black" class="denglu"><a href="../html/login.html" style="color: black;text-decoration: none;">登录/</a></div>
                <div style="font-size: 20px;line-height: 70px;text-decoration: none;color: black" class="zhuce"> <a href="../html/create.html" style="color: black;text-decoration: none;">注册</a></div>
            </div>
            <div class="shoppingcar">
                <a href="../html/shoppingcar.html" style="text-decoration: none;color: black;"><span class="iconfont icon-gouwuche" style="font-size: 30px;line-height: 70px;"></span></a>
            </div>
            <div class="GPS-mao">

                <div class="GPS-mao-list">
                    <ul>
                        <a href="">
                            <li>
                                palace普通款
                            </li>
                        </a>
                        <a href="">
                            <li>
                                palace联名款
                            </li>
                        </a>

                        </li>
                    </ul>
                </div>
                <div class="GPS-mao-imgs">
                    <ul>
                        <li>
                            <a href="goods.html"><img src="../img/CLOTHESLIST/HATS/HATS4.webp" alt=""></a>
                        </li>
                        <li>
                            <a href="goods.html"><img src="../img/CLOTHESLIST/HATS/HATS5.webp" alt=""></a>
                        </li>
                        <li>
                            <a href="goods.html"><img src="../img/CLOTHESLIST/HATS/HATS6.webp" alt=""></a>
                        </li>
                        <li>
                            <a href="goods.html"><img src="../img/CLOTHESLIST/HATS/HATS8.webp" alt=""></a>
                        </li>
                    </ul>


                </div>
            </div>
            <div class="GPS-jacket">

                <div class="GPS-jacket-list">
                    <ul>
                        <li>
                            <a href="">普通款 </a>
                        </li>
                        <li>
                            <a href="">联名款</a>
                        </li>
                    </ul>
                </div>
                <div class="GPS-jacket-imgs">
                    <img src="../img/CLOTHESLIST/JACKETS/JACKETS1.webp" alt="">
                    <img src="../img/CLOTHESLIST/JACKETS/JACKETS2.webp" alt="">
                    <img src="../img/CLOTHESLIST/JACKETS/JACKETS3.webp" alt="">
                    <img src="../img/CLOTHESLIST/JACKETS/JACKETS4.webp" alt="">
                </div>
            </div>
            <div class="GPS-pants">
                <div class="GPS-pants-list">
                    <ul>
                        <li>
                            <a href="">普通款</a> </li>
                        <li>
                            <a href="">联名款</a> </li>
                        <li>
                </div>
                <div class="GPS-pants-imgs">
                    <img src="../img/CLOTHESLIST/BOTTOMS/BOTTOMS1.webp" alt="">
                    <img src="../img/CLOTHESLIST/BOTTOMS/BOTTOMS2.webp" alt="">
                    <img src="../img/CLOTHESLIST/BOTTOMS/BOTTOMS3.webp" alt="">
                    <img src="../img/CLOTHESLIST/BOTTOMS/BOTTOMS4.webp" alt="">
                </div>
            </div>
            <div class="GPS-bag">
                <div class="GPS-bag-list">
                    <ul>

                        <li>
                            <a href="">普通款</a> </li>
                        <li>
                            <a href="">联名款</a> </li>
                        <li>
                    </ul>
                </div>
                <div class="GPS-bag-imgs">
                    <img src="../img/CLOTHESLIST/BAGS/BAGS1.webp" alt="">
                    <img src="../img/CLOTHESLIST/BAGS/BAGS3.webp" alt="">
                    <img src="../img/CLOTHESLIST/BAGS/BAGS4.webp" alt="">
                    <img src="../img/CLOTHESLIST/BAGS/BAGS6.webp" alt="">

                </div>
            </div>
        </div>
    </div>
    <div class="goodsContent-neirong">
        <div class="goodsContent-neirong-center">
            <div class="goodsContent-neirong-zuo">
                <div class="goodsContent-xiaotu">
                    <!-- <img src="../img/CLOTHESLIST/JACKETS/JACKETS3.webp" alt=""> -->
                </div>
            </div>
            <div id="shopping-neirong-center-bigimgs">
                <div id="shopping-neirong-center-bigimgs1"></div>
                <div id="shopping-neirong-center-bigimgs2"></div>
            </div>
            <div class="shopping-neirong-center-message">
                <div class="shopping-neirong-center-header">
                    <div class="shopping-neirong-center-jiage">
                        <!-- <span>$999.00</span> -->
                    </div>
                </div>
                <div class="shopping-neirong-center-name">
                    <!-- <h1>GREEK VARSITYJACKET</h1> -->
                </div>


                <div class="shopping-neirong-center-size">
                    <div class="shopping-neirong-center-sizeheader">
                        <div>尺码:</div>
                        <div>尺码&尺码表</div>
                    </div>
                    <br>
                    <h5>尺码:</h5>
                    <br>
                    <div class="shopping-neirong-center-sizenum">
                        <button>S</button>
                        <button>L</button>
                        <button>X</button>
                        <button>XL</button>
                    </div>
                    <br>
                    <h5>宽度:</h5>
                    <br><button style="width:140px;height:60px;border: none;background-color: black;color: white;">标准宽度</button>

                    <div class="shopping-neirong-center-sizeadd">
                        <a href="../html/shoppingcar.html">
                            <div class="shopping-neirong-center-sizeadd-shoppingcar">
                                <div style="line-height: 70px; " class="shopping-neirong-center-sizeadd-shoppingcar-jiage"></div>
                                <div class="carbt">加入购物车<span class="iconfont icon-gouwuche" style="font-size: 20px;line-height: 70px;"></span></div>
                            </div>
                        </a>

                        <div class="shopping-neirong-center-sizeadd-shoppingmoney">
                            <div style="line-height: 70px;">￥结账</div>

                        </div>
                    </div>
                    <br>
                    <h5>数量</h5>
                    <div class="num">1</div>

                </div>
            </div>
        </div>
    </div>
    <div class="bigdonghua">
        <div class="bigdonghua-center">
            <div class="donghua"></div>
            <div class="donghua"></div>
            <div class="donghua"></div>
            <div class="donghua">
            </div>
        </div>

    </div>
    <div class="foot ">
        <div class="foot-center ">
            <div class="foot-head ">
                <div class="place ">
                    <span class="iconfont icon-zuobiao " style="font-size: 40px;color: red; "></span>
                    <span>查找店铺</span>

                </div>
                <div class="follow ">
                    <span class="iconfont icon-aite " style="font-size: 40px;color: red; "></span>
                    <span>订阅资讯</span>
                </div>
            </div>
            <div class="survice ">
                <div class="survice-one ">
                    <h3>帮助中心</h3>
                    <ul>
                        <li><a href=" "> 购买须知</a></li>
                        <li>
                            <a href=" ">配送及费用</a>
                        </li>
                        <li>
                            <a href=" ">支付方式</a>
                        </li>
                        <li>
                            <a href=" ">退货政策</a>
                        </li>
                    </ul>
                </div>
                <div class="survice-one ">
                    <h3>我的订单</h3>
                    <ul>
                        <li>
                            <a href=" ">订单查询</a>
                        </li>
                        <li>
                            <a href=" ">关于发票</a>
                        </li>
                    </ul>
                </div>
                <div class="survice-one ">
                    <h3>关于NB</h3>
                    <ul>
                        <li>
                            <a href=" ">品牌故事</a>
                        </li>
                        <li>
                            <a href=" ">隐私政策</a>
                        </li>
                        <li>
                            <a href=" ">使用条款</a>
                        </li>
                    </ul>
                </div>
                <div class="survice-one ">
                    <h3>保持联系</h3>
                    <span class="iconfont icon-weixin " style="font-size: 50px; "></span>
                    <span class="iconfont icon-weibo " style="font-size: 50px; "></span>
                    <br><span style="font-size: 12px; ">客服热线：<br>
                        800-820-2887(请使用固话拨打)<br>
                        400-890-2887(请使用手机拨打)<br>
                        电话服务时间：周一~周五 9AM~6PM（节假日除外）<br>
                        在线服务时间：<br>
                        周一 ~ 周日<br>
                        9AM ~ 10PM<br></span>
                </div>
            </div>

        </div>
    </div>
    <div></div>
    <div id="myBtn">↑</div>
</body>

</html>
<script src="../js/cookie.js"></script>
<script src="../js/GPS.js"></script>
<script src="../js/bigmirror.js"></script>
<script src="../js/jquery-3.2.1.min.js"></script>
<script>
    $(function() {
        getFetch()
    })
    var goodID = location.search.slice(1).split('=')[1];

    function getFetch() {
        $.get('./PHP/getGoodsInfo.php', {
            'goodsId': goodID
        }, function(data) {
            console.log(data);
            let str1 = `<img src="${data.goodsImg}" alt="">`;
            $(".goodsContent-xiaotu").html(str1)
            $("#shopping-neirong-center-bigimgs").css("background-image", `url(${data.goodsImg})`).css("background-size", `515px 450px`)
            $("#shopping-neirong-center-bigimgs1").css("background-image", `url(${data.goodsImg})`).css("background-size", `1000px 1000px`)
            let str2 = `
          <span>${data.goodsPrice}</span>
          `
            let str3 = `
            <h1>${data.goodsName}</h1>
            `
            $(".shopping-neirong-center-sizeadd-shoppingcar-jiage").html(str2)
            $(".shopping-neirong-center-name").html(str3)
            $(".shopping-neirong-center-jiage").html(str2)
            $(".goodsContent-xiaotu").html(str1)
        }, 'json')



        $(".shopping-neirong-center-sizeadd-shoppingcar").on('click', '.carbt', function() {
            $.post('./PHP/addShoppingCart.php', {
                'vipName': getCookie('username'),
                'goodsId': goodID,
                'goodsCount': $('.num').text()
            }, function(data) {
                console.log(data);
                if (data.trim() == '1') {
                    alert('添加成功')
                    setTimeout(() => {
                        location.href = "shoppingcar.html";
                    }, 1000)
                } else {
                    alert('添加失败')
                }
            })

        })
    }
    if (document.cookie) {
        $('.user').html(getCookie('login').split(',')[0])
    } else {
        $('.user').html("palace俱乐部");
        $('.user').on('click', function() {
            location.href = 'create.html';
        })

    }
</script>